/*
Theme Name: Retro VHS Video Hall
Author: Manus AI
Description: 80s VHS retro nostalgic style for xiaoxuanfeng spider pool pro.
*/

/* 1. Global Styles & Variables
-------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

:root {
    --bg-color: #1a1a1a;
    --primary-glow: #33ff33;
    --secondary-glow: #33ccff;
    --accent-color: #ff8833;
    --text-color: #f5f0e0;
    --font-primary: 'VT323', monospace;
    --font-secondary: 'Press Start 2P', cursive;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    font-size: 1.2rem;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

a {
    color: var(--secondary-glow);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
}

.content-area {
    flex: 3;
}

.sidebar {
    flex: 1;
}

.section-title {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    color: var(--primary-glow);
    text-shadow: 0 0 8px var(--primary-glow);
    border-bottom: 2px solid var(--primary-glow);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.section-title span {
    background-color: var(--bg-color);
    padding-right: 10px;
}

/* 2. VHS/CRT Effects
-------------------------------------------------- */
.vhs-body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0,
        rgba(0, 0, 0, 0.4) 2px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 9999;
}

.vhs-body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    animation: vhs-noise-anim 0.15s steps(4) infinite;
    pointer-events: none;
    z-index: 9998;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.vhs-body {
    animation: screen-shake 8s infinite ease-in-out;
}

.vhs-top-line {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    animation: color-flicker 0.5s infinite alternate;
}

@keyframes vhs-noise-anim {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-2px, 2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-1px, 1px); }
    100% { transform: translate(1px, -1px); }
}

@keyframes screen-shake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    10% { transform: translate(-1px, 1px) rotate(-0.1deg); }
    20% { transform: translate(1px, -1px) rotate(0.1deg); }
    30% { transform: translate(-1px, -1px) rotate(0); }
    40% { transform: translate(1px, 1px) rotate(0.1deg); }
    50% { transform: translate(0, 0) rotate(0); }
    90% { transform: translate(0, 0) rotate(0); }
    95% { transform: translate(-2px, 0) rotate(-0.2deg); }
    98% { transform: translate(2px, 0) rotate(0.2deg); }
}

@keyframes color-flicker {
    from { opacity: 0.8; filter: brightness(1); }
    to { opacity: 1; filter: brightness(1.2); }
}

/* 3. Header
-------------------------------------------------- */
.site-header {
    background: #111;
    border-bottom: 2px solid var(--secondary-glow);
    box-shadow: 0 0 15px var(--secondary-glow);
    position: relative;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-img {
    width: 160px;
    height: auto;
    animation: logo-glitch 5s infinite steps(10);
}

@keyframes logo-glitch {
    0%, 100% { clip-path: inset(0 0 0 0); }
    10% { clip-path: inset(20% 0 60% 0); transform: translateX(-2px); }
    20% { clip-path: inset(80% 0 5% 0); transform: translateX(2px); }
    30% { clip-path: inset(40% 0 40% 0); transform: translateX(-1px); }
    40% { clip-path: inset(90% 0 2% 0); transform: translateX(1px); }
    50% { clip-path: inset(0 0 0 0); transform: translateX(0); }
}

.main-nav ul {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    padding: 5px 10px;
    border: 1px solid transparent;
}

.main-nav a:hover {
    border-color: var(--accent-color);
    background: rgba(255, 136, 51, 0.1);
}

.header-search .search-input {
    background: #222;
    border: 1px solid var(--primary-glow);
    color: var(--primary-glow);
    padding: 8px 12px;
    font-family: var(--font-primary);
    font-size: 1rem;
    width: 200px;
}

.header-search .search-input::placeholder {
    color: rgba(51, 255, 51, 0.5);
}

.header-search .search-button {
    background: var(--primary-glow);
    color: var(--bg-color);
    border: none;
    padding: 9px 15px;
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    margin-left: -5px;
}

/* 4. Footer
-------------------------------------------------- */
.site-footer {
    background: #111;
    border-top: 2px solid var(--secondary-glow);
    padding: 2rem 0 0;
    margin-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column ul li a {
    font-size: 1rem;
}

.footer-bottom {
    text-align: center;
    padding: 1rem 0;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #888;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* 5. Sidebar (right.html)
-------------------------------------------------- */
.widget {
    background: rgba(0,0,0,0.3);
    border: 1px solid #333;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget-title {
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    color: var(--secondary-glow);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--secondary-glow);
}

.ranking-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.ranking-list .hits {
    color: #888;
    font-size: 0.9rem;
}

.recommended-list .rec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.rec-pic {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #444;
}

.widget-categories ul li {
    border-bottom: 1px dotted #444;
}

.widget-categories ul li a {
    display: block;
    padding: 8px 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    padding: 3px 8px;
    background: #333;
    border-radius: 3px;
}

/* 6. Homepage (index.html)
-------------------------------------------------- */
.hero-section {
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tv-screen-bezel {
    background: #101010;
    border: 15px solid #282828;
    border-radius: 30px 30px 100px 100px / 30px 30px 60px 60px;
    padding: 20px;
    box-shadow: inset 0 0 20px #000, 0 10px 20px #000;
    width: 100%;
    max-width: 800px;
}

.tv-screen-content {
    background: #000;
    border: 5px solid #333;
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--primary-glow);
    text-shadow: 0 0 10px var(--primary-glow);
    animation: text-flicker 3s infinite alternate;
}

@keyframes text-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 5px var(--primary-glow), 0 0 10px var(--primary-glow), 0 0 15px var(--primary-glow);
        opacity: 1;
    }
    20%, 24%, 55% {
        text-shadow: none;
        opacity: 0.8;
    }
}

.tv-screen-content h1 {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-button {
    display: inline-block;
    margin-top: 1.5rem;
    background: var(--accent-color);
    color: #000;
    padding: 12px 25px;
    font-family: var(--font-secondary);
    text-transform: uppercase;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #000;
    transition: all 0.2s ease;
}

.cta-button:hover {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 #000;
    color: #000;
}

.breadcrumb-bar {
    background: #222;
    padding: 10px 15px;
    margin-bottom: 2rem;
    border-left: 5px solid var(--primary-glow);
    font-size: 1rem;
}

.movie-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.movie-card {
    display: flex;
    background: #222;
    border: 1px solid #333;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.movie-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px var(--secondary-glow);
}

.movie-card .card-image-link {
    flex: 0 0 150px;
    position: relative;
    overflow: hidden;
}

.movie-card .card-image-link::after {
    content: 'PLAY';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: var(--primary-glow);
    padding: 10px 15px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .card-image-link::after {
    opacity: 1;
}

.movie-card img {
    width: 150px;
    height: 220px;
    object-fit: cover;
    filter: saturate(0.8) contrast(1.2);
}

.card-content {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.card-title a {
    font-family: var(--font-secondary);
    font-size: 1.3rem;
    color: var(--text-color);
}

.card-meta {
    font-size: 0.9rem;
    color: #888;
    margin: 0.5rem 0;
}

.card-info {
    font-size: 1rem;
    flex-grow: 1;
    color: #aaa;
}

/* 7. List Page (list.html)
-------------------------------------------------- */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.list-item-card {
    display: flex;
    background: #252525;
    border-left: 5px solid var(--accent-color);
    animation: tape-rewind 0.5s steps(2, end) infinite;
    background-image: linear-gradient(to right, rgba(255,255,255,0.05) 50%, transparent 50%);
    background-size: 10px 100%;
}

@keyframes tape-rewind {
    from { background-position: 0 0; }
    to { background-position: -20px 0; }
}

.list-item-card .item-image-link {
    flex: 0 0 200px;
}

.list-item-card img {
    width: 200px;
    height: 100%;
    object-fit: cover;
}

.item-content {
    padding: 1.5rem;
}

.item-title a {
    font-size: 1.8rem;
    color: var(--text-color);
}

.item-meta {
    font-size: 0.9rem;
    color: #999;
    margin: 0.5rem 0 1rem;
}

.item-info {
    margin-bottom: 1rem;
}

.read-more {
    font-family: var(--font-secondary);
    color: var(--accent-color);
}

.pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination a, .pagination span {
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid var(--primary-glow);
    background: #222;
}

.pagination .current {
    background: var(--primary-glow);
    color: var(--bg-color);
    font-weight: bold;
}

/* 8. Show Page (show.html)
-------------------------------------------------- */
.post-content {
    background: #222;
    padding: 2rem;
    border: 1px solid #444;
}

.post-title {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    color: var(--primary-glow);
    text-align: center;
    margin-bottom: 1rem;
}

.post-meta {
    text-align: center;
    color: #888;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.post-body {
    font-size: 1.3rem;
    line-height: 1.8;
}

.post-poster {
    float: left;
    margin: 0 2rem 1rem 0;
    max-width: 300px;
    border: 5px solid var(--bg-color);
    box-shadow: 0 0 10px #000;
}

.post-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed #555;
}

.post-tags a {
    margin-left: 10px;
    background: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 1rem;
    background: #222;
}

.faq-section {
    margin: 3rem 0;
}

.faq-question {
    background: #2a2a2a;
    padding: 1rem;
    cursor: pointer;
    border-left: 3px solid var(--secondary-glow);
    margin-top: 1rem;
    position: relative;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--primary-glow);
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 1rem;
    background: #222;
    display: none; /* Toggled by JS */
}

.related-posts {
    margin-top: 3rem;
}

/* 9. Anti-interference & Utility
-------------------------------------------------- */
.xf7k2m, .qw3p8n, .zt9v1x {
    opacity: 0;
    font-size: 1px;
    position: absolute;
    pointer-events: none;
    width: 0;
    height: 0;
    overflow: hidden;
}

.lazyload {
    opacity: 0;
    transition: opacity 0.5s;
}

.lazyload.loaded {
    opacity: 1;
}

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 10. Responsive Design
-------------------------------------------------- */

/* For Tablets */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem;
    }

    .main-nav {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }

    .main-nav ul {
        justify-content: center;
    }

    .list-item-card {
        flex-direction: column;
    }

    .list-item-card .item-image-link,
    .list-item-card img {
        width: 100%;
        max-height: 250px;
        object-fit: cover;
    }
}

/* For Mobile (landscape) */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .movie-card {
        flex-direction: column;
    }

    .movie-card .card-image-link,
    .movie-card img {
        width: 100%;
        height: auto;
    }

    .post-poster {
        float: none;
        margin: 0 auto 1.5rem;
        max-width: 80%;
    }
}

/* For Mobile (portrait) */
@media (max-width: 480px) {
    .header-search {
        width: 100%;
        margin-top: 1rem;
    }

    .header-search .search-input {
        width: calc(100% - 70px);
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .tv-screen-content h1 {
        font-size: 1.8rem;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
